package cn.pomelo.album.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import cn.pomelo.album.mapper.ImageMapper;
import cn.pomelo.album.model.Image;
import cn.pomelo.album.service.ImageService;

import java.util.List;

@Service
public class ImageServiceImpl implements ImageService{

    @Resource
    private ImageMapper imageMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return imageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Image record) {
        return imageMapper.insert(record);
    }

    @Override
    public int insertSelective(Image record) {
        return imageMapper.insertSelective(record);
    }

    @Override
    public Image selectByPrimaryKey(Integer id) {
        return imageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Image record) {
        return imageMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Image record) {
        return imageMapper.updateByPrimaryKey(record);
    }


    @Override
    public List<Image> selectByFolderAndUserid(String folder, String userid) {
        return imageMapper.selectByUserid(folder,userid);
    }

    @Override
    public List<String> selectFolderByUserid(String userid) {
        return imageMapper.selectFolderByUserid(userid);
    }

    @Override
    public int deleteByFolder(String folder) {
        return imageMapper.deleteByFolder(folder);
    }

}
